package com.example.mapper;

import com.example.entity.GameInfo;
import com.example.entity.GymInfo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface GymMapper {

    @Insert("insert into gym_info(gym_id,name,location,sitenumber1,sitenumber2,sitenumber3)" +
            "values(#{gymId},#{name},#{location},#{siteNumber1},#{siteNumber2},#{siteNumber3})")
    void insert(GymInfo gymInfo);

    @Delete("delete from gym_info where id=#{id}")
    void deleteById(Integer id);

    @Update("update gym_info set gym_id=#{gymId},name=#{name},location=#{location},"+
            "sitenumber1=#{siteNumber1},sitenumber2=#{siteNumber2},sitenumber3=#{siteNumber3}  "+
             "where id = #{id}")
    void updateById(GymInfo gymInfo);


    List<GymInfo> selectAll(String gymName, String gymLocation);


}
